<template>
	<view>
		<u-navbar title="系统公告"></u-navbar>
		<view class="message">
			<template v-if="!$u.test.empty(message)">
				<view class="content">{{ message.content }}</view>
				<view class="date">{{ message.update_time }}</view>
			</template>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			message: {}
		};
	},
	onLoad(option) {
		this.getSystemMessage(option.id);
	},
	methods: {
		// 列表
		getSystemMessage(id) {
			this.$edu.api
				.getUserSystemMessage({
					page: 1,
					count: 999
				})
				.then(res => {
					const { data } = res;
					this.message = data.data.find(item => item.id == id);
				});
		}
	}
};
</script>

<style lang="scss" scoped>
.message {
	padding: 30rpx;
	background-color: #fff;
	min-height: calc(100vh - 44px);
	.content {
		font-size: 28rpx;
		font-weight: 400;
		color: $edu-main-color;
		line-height: 46rpx;
		word-break: break-all;
	}
	.date {
		margin-top: 20rpx;
		font-size: 24rpx;
		font-weight: 400;
		color: $edu-tips-color;
	}
}
</style>
